import 'dart:convert' show json;

class DancerDetails {

  int? cursor;
  int? err;
  String? err_msg;
  String? token;
  Data? data;

  DancerDetails.fromParams({this.cursor, this.err, this.err_msg, this.token, this.data});

  factory DancerDetails(Object jsonStr) => jsonStr is String ? DancerDetails.fromJson(json.decode(jsonStr)) : DancerDetails.fromJson(jsonStr);

  static DancerDetails? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : DancerDetails(jsonStr);

  DancerDetails.fromJson(jsonRes) {
    cursor = jsonRes['cursor'];
    err = jsonRes['err'];
    err_msg = jsonRes['err_msg'];
    token = jsonRes['token'];
    data = jsonRes['data'] == null ? null : Data.fromJson(jsonRes['data']);
  }

  @override
  String toString() {
    return '{"cursor": $cursor, "err": $err, "err_msg": ${err_msg != null?'${json.encode(err_msg)}':'null'}, "token": ${token != null?'${json.encode(token)}':'null'}, "data": $data}';
  }

  String toJson() => this.toString();
}

class Data {

  int? update_time;
  String? html_file_path;
  String? id;
  String? img_url;
  String? md_file_path;
  String? nickname;
  List<String>? img_urls;

  Data.fromParams({this.update_time, this.html_file_path, this.id, this.img_url, this.md_file_path, this.nickname, this.img_urls});

  Data.fromJson(jsonRes) {
    update_time = jsonRes['update_time'];
    html_file_path = jsonRes['html_file_path'];
    id = jsonRes['id'];
    img_url = jsonRes['img_url'];
    md_file_path = jsonRes['md_file_path'];
    nickname = jsonRes['nickname'];
    img_urls = jsonRes['img_urls'] == null ? null : [];

    for (var img_urlsItem in img_urls == null ? [] : jsonRes['img_urls']){
      img_urls!.add(img_urlsItem);
    }
  }

  @override
  String toString() {
    return '{"update_time": $update_time, "html_file_path": ${html_file_path != null?'${json.encode(html_file_path)}':'null'}, "id": ${id != null?'${json.encode(id)}':'null'}, "img_url": ${img_url != null?'${json.encode(img_url)}':'null'}, "md_file_path": ${md_file_path != null?'${json.encode(md_file_path)}':'null'}, "nickname": ${nickname != null?'${json.encode(nickname)}':'null'}, "img_urls": $img_urls}';
  }

  String toJson() => this.toString();
}